An essential semiconductor device is semiconductor memory, such as a random access memory (RAM) device. A RAM allows a memory circuit to execute both read and write operations on its memory cells. Typical examples of RAM devices include dynamic random access memory (DRAM) and static random access memory (SRAM).
Another form of memory is the content addressable memory (CAM) device. A conventional CAM is viewed as a static storage device constructed of modified RAM cells. A CAM is a memory device that accelerates any application requiring fast searches of a database, list, or pattern, such as in database machines, image or voice recognition, or computer and communication networks. CAMs provide benefits over other memory search algorithms by simultaneously comparing the desired information (i.e., data in the comparand register) against the entire list of pre-stored entries. As a result of their unique searching algorithm, CAM devices are frequently employed in network equipment, particularly routers, gateways and switches, computer systems and other devices that require rapid content searching, such as routing tables for data networks or matching URLs. Some of these tables are “learned” from the data passing through the network. Other tables, however, are fixed tables that are loaded into the CAM by a system controller. These fixed tables reside in the CAM for a relatively long period of time. A word in a CAM is typically very large and can be 96 bits or more.
In order to perform a memory search in the above-identified manner, CAMs are organized differently than other memory devices (e.g., DRAM and SRAM). For example, data is stored in a RAM in a particular location, called an address. During a memory access, the user supplies an address and reads into or gets back the data at the specified address.
In a CAM, however, data is stored in locations in a somewhat random fashion. The locations can be selected by an address bus, or the data can be written into the first empty memory location. Every location has one of a pair of status bits that keep track of whether the location is storing valid information in it or is empty and available for writing.
Once information is stored in a memory location, it is found by comparing every bit in memory with data in the comparand register. When the contents stored in the CAM memory location does not match the data in the comparand register, the local match detection circuit returns a no match indication. When the contents stored in the CAM memory location matches the data in the comparand register, the local match detection circuit returns a match indication. If one or more local match detect circuits return a match indication, the CAM device returns a “match” indication. Otherwise, the CAM device returns a “no-match” indication. In addition, the CAM may return the identification of the address location in which the desired data is stored or one of such addresses, if more than one address contained matching data. Thus, with a CAM, the user supplies the data and gets back the address if there is a match found in memory.
Conventional CAMs use priority encoders to translate the physical location of a searched pattern that is located to a number/address identifying that pattern. Typically, priority encoders are designed as a major block common to the whole device. Such a design requires conductors from virtually every word in the CAM to be connected to the priority encoder. Typically, a priority encoder consists of two logical blocks—a highest priority indicator and an address encoder.
A priority encoder is a device with a plurality of inputs, wherein each of the inputs has an assigned priority. When an input is received on a high priority line in a highest priority indicator, all of the inputs of a lesser priority are disabled, forcing their associated outputs to remain inactive. If any number of inputs are simultaneously active, the highest priority indicator will activate only the output associated with the highest priority active input, leaving all other outputs inactive. Even if several inputs are simultaneously active, the priority encoder will only indicate the activity of the input with the highest priority. The priority address encoder is used in the CAM as the means to translate the position (within the CAM) of a matching word into a numerical address representing that location. The priority address encoder is also used to translate the location of only one word and ignore all other simultaneously matching words. However, conventional CAM priority systems have been unable to simultaneously resolve multiple CAM words having mismatching bits.
A need exists in the art to effectively resolve “imperfect” matches, that is, stored CAM words that may match only a certain number of bits of the data in the comparand, but do not match every bit. Such CAM words are referred to as having a “near match” condition. A CAM word capable of detecting a near match condition is also known in the art as a “correlator,” where two patterns are correlated against each other. In prior art CAMs, a search for the nearest match is performed in one of two ways. In the first method, using binary CAMs, if an exact match is not found on the full between the stored word and the level of correlation between the two patterns reflects the number bits in the two patterns that are identical in both patterns. Typically the level of correlation between two patterns is given as the percentage of correlation, wherein 100% correlation indicates a perfect match between the two correlated patterns.
In data network communication, CAMs are also used as a tool for searching in the database of a network's client addresses. These searches typically require a pattern of bits to match exactly (i.e., 100%) with the searched pattern. For this reason, prior art CAMs search for a full match between every bit stored in a word and every unmasked bit in the comparand register, with certain bits in the comparand being masked. Search operations are repeated in an attempt to find a shorter match. If one bit of the comparand is masked at a time, then finding the longest possible match may require many repeated and undesirable operations/searches. In the present invention, the CAM is modified to allow less than 100% of correlation, and thus enable the use of a CAM in applications of pattern recognition, which do not require 100% correlation, but require a known high percentage of correlation between patterns. Such a high percentage of correlation means that only very few bits do not match between two patterns and a “near match” condition exists.